﻿using System;
using System.Collections.Generic;
using System.Configuration;
using Citi.PTSConsolidation.Domain.Utils;
using Citi.RoutineBase;

namespace Citi.PTSConsolidation.SchedulerUI
{
    public class ShrinkPts : IExecutableRoutine
    {
        private static string PtsConnectionString { get { return ConfigurationManager.AppSettings["PtsConnectionString"]; } }

        public IEnumerable<RoutineParameter> Parameters { get { return null; } }

        public void Rollback(ref ICurrentAction currentAction, Dictionary<string, object> parameters)
        {

        }

        public void Start(DateTime scheduledDate, ref ICurrentAction currentAction, Dictionary<string, object> parameters)
        {
            var query = "EXEC sp_Shrink";
            currentAction.Description = query;
            SqlHelper.ExecuteReader(query, PtsConnectionString);
        }

        public void Stop(ref ICurrentAction currentAction, Dictionary<string, object> parameters)
        {

        }
    }
}
